<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
 * @todo 	分类model
 * @author shiqiliang<ozil1987@gmail.com>
 * @package package_declaration
 * @subpackage mysite
 * @version 2013-11-21
 */
class Category_model extends My_Model{
	
	var	$tableName			= 'categories';

    function __construct()
    {
        parent::__construct();
		$this->load->database();
    }
    
    /**
	 * 根据分类获取列表
	 * 
	 * @param string $type
	 * @return array();
	 */
	function getCategory($type=false,$isShow=false){
		$where =  array();
		if($type!=false){
			$where =  array('type'=>$type);
		}
		if($isShow!=false){
			$where =  array('status'=>$isShow);
		}
		return $this->find(
			array(
				'order' => 'sorts DESC',
				'where' => $where,
			)
		);
	}
}
/* End of file category_model.php */
/* Location: ./application/models/category_model.php */